//
//  YDFont.m
//  IngCard
//
//  Created by kf on 2017/8/14.
//  Copyright © 2017年 IngDan. All rights reserved.
//

#import "YDStyle.h"
#import "YDColor.h"

@implementation UIFont(YDStyle)
+ (UIFont *)lightFontOfSize:(CGFloat)fontSize {
    return [UIFont fontWithName:@"PingFangSC-Light" size:fontSize];
}

+ (UIFont *)thinFontOfSize:(CGFloat)fontSize {
    return [UIFont fontWithName:@"PingFangSC-Thin" size:fontSize];
}

+ (UIFont *)mediumFontOfSize:(CGFloat)fontSize {
    return [UIFont fontWithName:@"PingFangSC-Medium" size:fontSize];
}

+ (UIFont *)semiblodFontOfSize:(CGFloat)fontSize {
    return [UIFont fontWithName:@"PingFangSC-Semibold" size:fontSize];
}

+ (UIFont *)regularFontOfSize:(CGFloat)fontSize {
    return [UIFont fontWithName:@"PingFangSC-Regular" size:fontSize];
}


@end

@implementation YDStyle

+(YDStyle *) style:(UIFont *) font color:(UIColor *) color
{
    YDStyle *target = [[YDStyle alloc] init];
    target.font = font;
    target.color = color;
    return target;
}

@end


@implementation YDStyleManager
+ (instancetype)sharedInstance {
    static dispatch_once_t onceToken;
    static YDStyleManager *instance = nil;
    dispatch_once(&onceToken,^{
        instance = [[super allocWithZone:NULL] init];
    });
    return instance;
}

+ (id)allocWithZone:(struct _NSZone *)zone{
    return [self sharedInstance];
}

-(void) renderDefault
{
    self.name = ([YDStyle style:UISemiblodFontMake(25) color:UIColorMake(44, 44, 44)]);
    self.timeSelection = [YDStyle style:UISemiblodFontMake(20) color:UIColorMake(87, 83, 83)];
    self.navigationBar = [YDStyle style:UIThinFontMake(20) color:UIColorMake(0, 0, 0)];
    
    self.roundButton = [YDStyle style:UIMediumFontMake(17) color:UIColorMake(255, 255, 255)];
    self.roundSquareButton = [YDStyle style:UIMediumFontMake(17) color:UIColorMake(255, 255, 255)];
    self.myList = [YDStyle style:UIRegularFontMake(17) color:UIColorMake(3, 3, 3)];
    
    self.contactList = [YDStyle style:UIThinFontMake(15) color:UIColorMake(0, 0, 0)];
    self.myCompany = [YDStyle style:UIMediumFontMake(14) color:UIColorMake(44, 44, 44)];
    
    self.signDescription = [YDStyle style:UILightFontMake(14) color:UIColorMake(41, 41, 41)];
    self.myOccupation = [YDStyle style:UILightFontMake(14) color:UIColorMake(44, 44, 44)];
    self.tabSelected = [YDStyle style:UILightFontMake(14) color:UIColorMake(248, 107, 107)];
    self.tab = [YDStyle style:UIThinFontMake(14) color:UIColorMake(0, 0, 0 )];
    self.myCardCardName = [YDStyle style:UIMediumFontMake(12) color:UIColorMake(0, 0, 0)];
    
    self.signDetailDescription = [YDStyle style:UILightFontMake(12) color:UIColorMake(151, 151, 151)];
    self.myCardActiveFeed = [YDStyle style:UIMediumFontMake(10) color:UIColorMake(82, 82, 82)];
    
    self.signConstruction = [YDStyle style:UILightFontMake(10) color:UIColorMake(41, 41, 41)];
    self.myCardPersionName = [YDStyle style:UIThinFontMake(9) color:UIColorMake(0, 0, 0)];
}
@end








